<template>
  <el-tooltip
    class="item"
    effect="dark"
    :content="tipcontent"
    placement="left-start"
  >
    <div class="software-item" @click="tp()">
      <div class="software-item-title flex-start">
        <div class="title-head">
          <img :src="imgUrl" alt="" />
        </div>
        <div class="title-text">
          <slot name="title-text"></slot>
        </div>
      </div>
      <div class="software-item-content">
        <slot name="content"></slot>
      </div>
    </div>
  </el-tooltip>
</template>

<script>
export default {
  name: "softwareitem",
  data() {
    return {
      property: "value",
    };
  },
  props: {
    img: {
      type: String,
      required: true,
    },
    tipcontent: {
      type: String,
    },
    href: {
      type: String,
    },
  },
  methods: {
    tp() {
      window.open(`${this.href}`);
    },
  },
  computed: {
    imgUrl() {
      return require("@/assets/img/software/" + this.img);
    },
  },
};
</script>

<style scoped>
.software-item {
  height: 95%;
  width: 230px;
  margin-right: 20px;
  padding-left: 20px;
  padding-right: 20px;
  padding-top: 2.5%;
  padding-bottom: 2.5%;
  background-color: #0c162d;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 10%), 0 3px 2px rgb(0 0 0 / 4%),
    0 7px 5px rgb(0 0 0 / 2%), 0 13px 10px rgb(0 0 0 / 2%),
    0 22px 17px rgb(0 0 0 / 2%) !important;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #8193b2;
  font-size: 0.7rem;
  letter-spacing: 1px;
  z-index: 2;
}
.software-item:hover {
  opacity: 0.7;
}
.software-item-title {
  width: 100%;
  height: 40px;
  font-weight: bold;
  width: 230px;
  letter-spacing: 0px;
}
.title-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}
.software-item-content {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.7rem;
}
.title-head {
  background-color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 35px;
  padding-left: 2.5px;
  padding-right: 2.5px;
  height: 40px;
  margin-top: -10px;
  border-radius: 5px;
  margin-right: 10px;
}
.title-head img {
  width: 30px;
}
</style>